String Functions


UPPER

Returns a character expression with lowercase character data converted to uppercase.

LOWER

Returns a character expression after converting uppercase character data to lowercase.

TRIM

Returns a character string after truncating all leading and trailing blanks.

LTRIM

Returns a character expression after removing leading blanks.

RTRIM

Returns a character string after truncating all trailing blanks.

SUBSTRING

Returns a substring of a string.

POS

Returns the index value of the first character in a specified substring that occurs in a given string. Pos is case-sensitive.

LENGTH

Returns number of characters in a string excluding the null terminator.



UPPER Function

Returns a character expression with lowercase character data converted to uppercase.


Syntax:

UPPER ( expression )


Arguments

expression

Is an expression of string or wide string types.


Example:

SELECT UPPER(Company) FROM Customer


LOWER Function

Returns a character expression after converting uppercase character data to lowercase.


Syntax:

LOWER ( expression )


Arguments

expression

Is an expression of string or wide string types.


Example:

SELECT LOWER(Company) FROM Customer


TRIM Function

Returns a character string after truncating all leading and trailing blanks.


Syntax:

TRIM ( expression )


Arguments

expression

Is an expression of string or wide string types.


Example:

SELECT TRIM(Company) FROM Customer


LTRIM Function

Returns a character expression after removing leading blanks.


Syntax:

LTRIM ( expression )


Arguments

expression

Is an expression of string or wide string types.


Example:

SELECT LTRIM(Company) FROM Customer


RTRIM Function


Returns a character string after truncating all trailing blanks.


Syntax:

RTRIM ( expression )


Arguments

expression

Is an expression of string or wide string types.


Example:

SELECT RTRIM(Company)  FROM Customer


SUBSTRING Function


Returns a substring of a string.


Syntax:

SUBSTRING (string, startindex [, length] )


Arguments

string

Is an expression of string or wide string type.

startindex

Is a constant that specifies the character position at which the extracted substring starts within the original string.

length

Is a constant that specifies number of characters being extracted from source string.


Example:

SELECT SUBSTRING(Company,2,5)  FROM Customer


POS Function


Returns the index value of the first character in a specified substring that occurs in a given string. Pos is case-sensitive.


Syntax:

POS ( substring, string )


Arguments

substring

Is a an expression of string or wide string type that specifies substring for searching in the specified string.

string

Is a an expression of string or wide string type that specifies source string.


Example:

SELECT * FROM Customer WHERE Pos('Bitespire',Company) > 0


LENGTH Function


Returns number of characters in a string excluding the null terminator.


Syntax:

LENGTH ( string )


Arguments

string

Is a an expression of string or wide string type.


Example:

SELECT * FROM Customer WHERE LENGTH(Company) > 5


Related Topics

Naming Conventions

Operators

String Functions

Date Functions